{layout name="layout" /}

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <title>任何冯相关材料或建议</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" type="text/css" href="/static/1219res/css/page_survey.css">
    <script type="text/javascript" src="/static/js/jquery/jquery.min.js"></script>
</head>

<body class="g_wrapper page_survey g_survey">
    <!-- 问卷主体 -->
    <div id="container" class="g_container">
        <!-- <div class="survey_background_wrap" style="height: 352px;"></div> -->
        <div class="g_content">
            <div class="survey_wrap no_title_index">
                <div class="survey_main">
                    <h1 class="survey_title" style="display: block;">
                        <div class="inner">
                            <div class="title_content">
                                <p>任何冯相关材料或建议</p>
                            </div>
                        </div>
                    </h1>
                    <div class="survey_content">
                        <div class="survey_prefix" style="display: block;">
                            <div class="inner">
                                <h2 class="prefix_content">
                                    <p> </p>
                                </h2>
                            </div>
                        </div>
                        <div class="survey_container">
                            <div class="survey_page" data-pid="1">
                                <div class="question question_textarea" data-type="textarea" id="question_q-1-DvmS"
                                    data-id="q-1-DvmS" style="display: block;">
                                    <div class="inner">
                                        <div class="title" id="questionTitle_q-1-DvmS"
                                            ">
                                            <div role=" presetation">
                                            <span class="title_index"> <span class="question_index" data-for="q-1-DvmS">1</span>.
                                            </span>
                                            <h3 class="title_text">
                                                <p>补充 / 建议 / 纠错，请写于下方</p>
                                            </h3>
                                        </div> <span class="tips" role="alert"> </span>
                                    </div>
                                    <div class="description">
                                        <div class="description_text">
                                            <p>或联系邮箱: admin@huwhois.win</p>
                                        </div>
                                    </div>
                                    <div class="inputs"> <textarea role="textbox" aria-labelledby="questionTitle_q-1-DvmS"
                                            class="survey_form_input" id="textarea_q-1-DvmS" name="answer_q-1-DvmS"
                                            rows="4" cols="60"></textarea> </div>
                                </div>
                            </div>
                            <div class="question question_textarea" data-type="textarea" id="question_q-2-HxEz" data-id="q-2-HxEz"
                                style="display: block;">
                                <div class="inner">
                                    <div class="title" id="questionTitle_q-2-HxEz" aria-label="第2题： 您的联系方式（可不填）">
                                        <div role="presetation"> <span class="title_index"> <span class="question_index"
                                                    data-for="q-2-HxEz">2</span>. </span>
                                            <h3 class="title_text">
                                                <p>您的联系方式（可不填）</p>
                                            </h3>
                                        </div> <span class="tips" role="alert"> </span>
                                    </div>
                                    <div class="description">
                                        <div class="description_text"> </div>
                                    </div>
                                    <div class="inputs"> <textarea role="textbox" aria-labelledby="questionTitle_q-2-HxEz"
                                            class="survey_form_input" id="textarea_q-2-HxEz" name="answer_q-2-HxEz"
                                            rows="2" cols="60"></textarea> </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="survey_control">
                        <div class="inner"><a href="javascript:void(0);" title="提交" aria-label="提交" role="button" class="survey_btn survey_submit"
                                style="display: inline-block;">提交</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <script>
        //字符串为空
        function isNull(str) {
            if (str == null || str == "" || str.length < 1)
                return true;
            else
                return false;
        }

        var layer;

        layui.use('layer', function () {
            layer = layui.layer;
        });

        $(".survey_submit").click(function () {
            var content = $("#textarea_q-1-DvmS").val();
            var link = $("#textarea_q-2-HxEz").val();

            if (isNull(content)) {
                layer.alert('提交内容不可为空');
                
                return false;
            }

            $.post('leacots', {
                'content': content,
                'link': link
            }, function (data) {
                if (data.code == 1) {
                    $("#textarea_q-1-DvmS").val("");
                    $("#textarea_q-2-HxEz").val("");
                    layer.alert('提交成功, 谢谢您的建言')
                } else {
                    // layer.msg("提交失败, 请稍后重试, 或邮箱联系");
                    layer.msg(data.msg);
                    return false;
                }
            })
        })
    </script>
</body>

</html>